//
// Created by 邹迪凯 on 2021/7/17.
//

#ifndef LWPT_ENTITY_H
#define LWPT_ENTITY_H

#include <vector>

#include "util.h"

class Chunk {
public:
    virtual long size() const = 0;

    virtual ~Chunk() = default;
};

class Location {
public:
    string lat; // 纬度
    string lon; // 经度

    Location() {}

    Location(string lat, string lon) : lat(lat), lon(lon) {}

    double distance(Location &loc) {
        return earthDistance(stod(lat), stod(lon), stod(loc.lat), stod(loc.lon));
    }

    friend ostream &operator<<(ostream &ostream, const Location &loc) {
        ostream << "(" << loc.lat << "," << loc.lon << ")";
        return ostream;
    }
};

class Task {
public:
    string id;
    Location location;

    Task(string id, Location location) : id(id), location(location) {}

    friend ostream &operator<<(ostream &ostream, const Task &task) {
        ostream << "T(" << task.id << task.location << ")";
        return ostream;
    }
};

#endif //LWPT_ENTITY_H
